import os
import shutil

dir_s = input("path:")
print(dir_s)
split_s = input("split:")
print(split_s)

the_list = os.listdir(path=dir_s)
print(the_list)
for filename in the_list:
    splits = filename.split(split_s)
    try:
        if splits[1]:
            new_name = splits[1].strip()
            shutil.move(dir_s + "/" + filename, dir_s + "/" + new_name)
    except IndexError as err:
        pass   
